<%@page import="code.CodeDTO"%>
<%@page import="code.CodeDAO"%>
<%@page import="java.util.ArrayList"%>
<%@page import="common.SerialDAO"%>
<%@page import="common.SerialDTO"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/FullCalendar/jquery.ui.datepicker-ko.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>사원등록</title>
<script src="${pageContext.request.contextPath}/homepage/salary/filePreview.js"></script>
<style type="text/css">
#center {
    z-index: 10;
	width: 993px;
	height: 90px;
	border: 1px solid #cccccc;
	position: relative;
	background-color: #F2F2F2;
	background-repeat: no-repeat;
	background-size: 100% 100%;
	border-radius: 5px;
	margin-left: 100px;
}

#menubar {
	width: 1000px;
	height: 0px;
	margin:auto;
}

#subject {
	width: 100px;
	border: 1px solid #eaeaea;
	float: left;
	text-align: center;
	height: 30px;
	line-height: 30px;
	border-left: 1px solid;
	border-right:1px solid;
	
}

.subject1 {
	text-indent: 3px;
	width: 200px;
	height: 20px;
	line-height: 20px; 
	margin-top:3px; 
	margin-left:10px;
}

#previewId{
	margin:auto;
	width: 100px;
	border: 1px solid #cccccc;
	height: 130px;
	float: left;
}

#b{
	width: 992px;
	
}

#c{
	width: 100px;
	border: 1px solid #eaeaea;
	float: left;
	text-align: center;
	height: 30px;
	line-height: 30px;
	border-left: 1px solid;
	border-right:1px solid;

}

.d{
	text-indent: 3px;
	width: 180px;
	height: 20px;
	line-height: 20px; 
	margin-top:3px; 
	margin-left:10px;

}
</style>
<script type="text/javascript">
window.onload = function () {
	$("#hd").datepicker({
		buttonImageOnly: true, //이미지만 보이기
		changeMonth: true,
		changeYear: true,
		autoSize: true,
	});
	
	$("#age").datepicker({
		buttonImageOnly: true, //이미지만 보이기
		changeMonth: true,
		changeYear: true,
		autoSize: true,
		dateFormat: 'yymmdd'
	});
	
	
};
</script>
</head>
<body>

	<%
			//채번을 하기위해 클래스에 필요 변수를 저장
			SerialDTO dto = new SerialDTO("salary","SA_no","M");
			//DB 작업 클래스 생성
			SerialDAO dao = new SerialDAO();
			//DB 작업클래스에 필요변수가 저장 되있는 클래스를 setter를 이용해 저장
			dao.setDto(dto);
			//채번한 결과 값을 변수에 저장
			String temp = dao.serialReturn();
			//화면에 뿌려주기 위한 로직
		    
		%>
		
		
		
		<!-- 공통코드 사용할때 가져오는.. grp1이 대분류-->
 <%  
	CodeDTO code = new CodeDTO();
	code.setCd_grp1("PST");
	CodeDAO cdao = new CodeDAO();
	cdao.setDto(code);
	ArrayList<CodeDTO> codess = cdao.returnCode();
 %>
 
 <%  
	CodeDTO code1 = new CodeDTO();
	code1.setCd_grp1("SADP");
	CodeDAO cdao1 = new CodeDAO();
	cdao1.setDto(code1);
	ArrayList<CodeDTO> codess1 = cdao1.returnCode();
 %>
 
 <%  
	CodeDTO code2 = new CodeDTO();
	code2.setCd_grp1("SAST");
	CodeDAO cdao2 = new CodeDAO();
	cdao2.setDto(code2);
	ArrayList<CodeDTO> codess2 = cdao2.returnCode();
 %>
 
<div style="height:20px"></div>
	<!-- 컨텐츠 안에서 탑  --> 
	<form id="frm" action="index.jsp?inc_content=./salary/salary_registration_result.jsp" method="post" enctype="multipart/form-data">
	<div id='center'>
		<h3>&nbsp;&nbsp;&nbsp;사원 등록</h3>
		<input type='submit' value='등록'   
			style='margin-top: 0px; margin-right: 10px; float: right; width:100px'>
			
	</div>
	
	<!-- 강제로 높이 지정 -->
	<div style="height: 300px; width: 1200px;">
	
	
		<div id="menubar" style='margin-top: 20px;'>
		<div id='previewId'> </div>
		<div id="b" style="border-right: 1px solid #cccccc"> <!-- 감싸고 -->
			<div style='border-top: 1px solid; float: left; border-right: 1px solid'>
				<div id= "c">사원번호</div>
				<div style="width: 338px; float: left;">
					<input type='text' readonly class="d" value='<%=temp %>' name='no'>
				</div>
				<div id="c">성별</div>
				<div style="width: 347px; float: left;">
					<select style="height: 25px;line-height: 20px; margin-top:3px; margin-left:10px;" name='sx'>
					<option value="">성별</option>
					<option value="남자">남자</option>
					<option value="여자" selected="selected">여자</option>
				</select>
				</div>
				</div>
				<div style='border-top: 1px solid; float: left; border-right: 1px solid'>
				<div id= "c">사원명</div>
				<div style="float: left; width: 338px;">
					<input type='text' class="d" value='박현정' name='nm'>
				</div>	
				<div id="c">직급</div>
				<div style="width: 347px; float: left;">
					<select style="height: 25px;line-height: 20px; margin-top:3px; margin-left:10px;" name='gd'>
					<!-- <option value="">직급</option>
					<option value="01" selected="selected">신입</option>
					<option value="02">대리</option>
					<option value="03">과장</option>
					<option value="04">팀장</option>
					<option value="05">이사</option> -->
					 <%
				for(int i=0; i<codess.size();i++){
				CodeDTO d = codess.get(i);
				%>
				<option value="<%=d.getCd_grp2()%>"><%=d.getCd_grp2_nm() %></option>
				<%}%>
				</select>
				</div>
				</div>
			<div style='border-top: 1px solid; float: left; border-right: 1px solid'>
				<div id="c">연락처</div>
				<div style="width: 338px; float: left;">
					<input type='text' class="d" value='010-5035-2547' name='ph'>
				</div>
				<div id="c">나이</div>
				<div style="width: 347px; float: left;">
					<input type='text' class="d" value='19920513' name='age' id='age'>
				</div>
			</div>
			<div style='border-top: 1px solid; float: left; border-right: 1px solid'>
				<div id="c">사진 업로드</div>
				<div style="width: 338px; float: left;">
					<input type='file' class="d" style="margin-top:3px; width: 300px; margin-top: 4px;"id='pho' name="pho" onchange="previewImage(this,'previewId','1')">
				</div>
				<div id="c">이메일</div>
				<div style="width: 347px; float: left;">
					<input type='text' class="d" value='park007@naver.com' name='email'>
				</div>
			</div>
		</div>
			<div style='border-top: 1px solid; float: left; border-right: 1px solid'>
				<div id="subject">주소</div>
				<div style="width: 889px; float: left;">
					<input type='text' class="subject1" style="width:528px;" value='서울특별시 종로구 율곡로 디아망 401호' name='address'>
				</div>
			</div>
            <div style='border-top: 1px solid; float: left; border-right: 1px solid'>
				<div id="subject">부서</div>
				<div style="width: 439px; float: left;">
					<select style="height: 25px;line-height: 20px; margin-top:3px; margin-left:10px;" name='dpm'>
					<!-- <option value=""> 부서</option>
					<option value="01">인사팀</option>
					<option value="02" selected="selected">개발팀</option>
					<option value="03">총무팀</option>
					<option value="04">홍보팀</option> -->
					<%
				for(int i=0; i<codess1.size();i++){
				CodeDTO d = codess1.get(i);
				%>
				<option value="<%=d.getCd_grp2()%>"><%=d.getCd_grp2_nm() %></option>
				<%}%>
				</select>
				</div>
				<div id="subject">상태코드</div>
				<div style="width: 348px; float: left;">
					<select style="height: 25px;line-height: 20px; margin-top:3px; margin-left:10px;" name='st'>
					<!-- <option value="">상태코드</option>
					<option value="01" selected="selected">재직</option>
					<option value="02">해임</option>
					<option value="03">휴직</option>
					<option value="04">퇴임</option>
					<option value="05">퇴사</option> -->
					<%
				for(int i=0; i<codess2.size();i++){
				CodeDTO d = codess2.get(i);
				%>
				<option value="<%=d.getCd_grp2()%>"><%=d.getCd_grp2_nm() %></option>
				<%}%>
				</select>
				</div>
				</div>
				<div style='border-top: 1px solid; float: left; border-right: 1px solid'>
				<div id="subject">입사일</div>
				<div style="width: 439px; float: left;">
					<input type='text' class="subject1" value='2014-08-22' style="width: 283px;" name='hd' id="hd">
				</div>
				
				<div id="subject">연봉</div>
				<div style="width: 348px; float: left;">
					<input type='text' class="subject1" value='2800' style="width: 180px;" name='sal'>
				</div>
				</div>
		
				<!-- 빈공간으로 만듬 한줄 띄운 효과발동!! -->
				<div style='border-top: 1px solid ; float: left; border-right: 1px solid white; height:10px;'>
				<div id= "subject" style="border-left: 0px solid white; border-right: 0px solid #ffffff; border-bottom: 0px solid white;" ></div>
				<div style="width: 890px; float: left;">
					</div>
				</div>
				<div style='border-top: 1px solid; float: left; border-right: 1px solid'>
				<div id="subject">결혼</div>
				<div style="width: 890px; float: left;">
					<select style="height: 25px;line-height: 20px; margin-top:3px; margin-left:10px;" name='marr'>
					<option value="">결혼</option>
					<option value="Y">Y</option>
					<option value="N" selected="selected">N</option>
				</select>
				</div>
				</div>
				<div style='border-top: 1px solid; float: left; border-right: 1px solid'>
				<div id="subject">주택소유여부</div>
				<div style="width: 890px; float: left;">
					<select style="height: 25px;line-height: 20px; margin-top:3px; margin-left:10px;" name='home'>
					<option value="">주택</option>
					<option value="Y">Y</option>
					<option value="N" selected="selected">N</option>
				</select>
				</div>
				</div>
				<div style='border-top: 1px solid; float: left; border-right: 1px solid'>
				<div id="subject">차량소유여부</div>
				<div style="width: 890px; float: left;">
					<select style="height: 25px;line-height: 20px; margin-top:3px; margin-left:10px;" name='car'>
					<option value="">차량</option>
					<option value="Y">Y</option>
					<option value="N" selected="selected">N</option>
				</select>
				</div>
				</div>
				<div style='border-top: 1px solid; float: left; border-right: 1px solid'>
				<div id="subject">은행명</div>
				<div style="width: 440px; float: left;">
					<input type='text' class="subject1" value='한국은행' style="width: 283px;" name='bknm'>
				</div>
			
				<div id="subject">예금주명</div>
				<div style="width: 348px; float: left;">
					<input type='text' class="subject1" value='박현정' style="width: 180px;" name='pynm'>
				</div>
			</div>
			<div style='border-top: 1px solid; border-bottom: 1px solid; float: left; border-right: 1px solid'>
				<div id="subject">계좌번호</div>
				<div style="width: 890px; float: left;">
					<input type='text' class="subject1" value='541582-25-985478' style="width: 283px;" name='acc'>
				</div>
			</div>
		  </div>
	   </div>
	</form>
	<div style="celar:both"></div>
	<div style="height:10px"></div>
</body>
</html>






